//package org.fms.web.service.impl;
//
//import org.fms.web.mapper.UserMapper;
//import org.fms.web.model.User;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
//import java.util.HashSet;
//
///**
// * PACKAGE     : org.fms.web.service.impl
// * CREATE DATE : 2018-03-07
// * AUTHOR      : xiaolu.fan
// * 文件描述     : 鉴别用户身份
// */
//@Service
//public class CustomUserService implements UserDetailsService {
//
//
//    @Autowired
//    private UserMapper userMapper;
//
//    @Override
//    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
//        User user = userMapper.getUserByUsername(s);
//        if (user == null) {
//            throw new UsernameNotFoundException("user is not exist!");
//        }
//        return new org.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(), new HashSet<>());
//    }
//}